Copyright  2019 HID Global Corporation/ASSA ABLOY AB. All rights reserved.

============================================
HID Global PKCS #11 API Java sample for IAIK
============================================

This sample demonstrates how to use the PKCS API version 2.20 provided with ActivID ActivClient 7.2 from a Java program and IAIK PKCS#11 Provider Version 1.4.
It implements the following scenarios:
-	How to use a signature key to sign data.
-	How to log on to the card.
-	How to write a secret key on the card, use it to encrypt or decrypt some data and then delete it.
-	How to generate an OTP.

		----------------------------------------------------

1 - Required runtime environment

	- Microsoft Windows 7 SP1 or later (32 and 64-bit editions)
	- ActivID ActivClient 7.2
	- Oracle Java Runtime Environment 1.7 or later
	- IAIK PKCS#11 Provider Version 1.4

		----------------------------------------------------

2 - Recommended development environment

	- Oracle Java Development Kit 1.7 or later

	Sample sources are located in the SDK\PKCS #11\Java\JavaSampleIAIK folder.

	Add the ActivClient 7.2 installation directory to the CLASSPATH environment variable (for example: set CLASSPATH=%CLASSPATH%;C:\Program Files\HID Global\ActivClient\).

	Download IAIK PKCS#11 Wrapper binaries from IAIK web site (https://jce.iaik.tugraz.at/sic/Products/Core_Crypto_Toolkits/PKCS_11_Provider)
	Copy the iaikPkcs11Wrapper.jar file in the same folder as pkcs.javasampleiaik_compilation.bat.
	Copy the IAIK pkcs11wrapper.dll file in ActivClient installation folder.
	
	The Java sample is provided together with two batch files. Simply copy the SDK\PKCS #11\Java\JavaSampleIAIK folder from the ActivClient distribution CD to a hard disk location, and open a command prompt at that location.
	
	First, run 'pkcs.javasampleiaik_compilation.bat' to produce the  .\Binaries\pkcs.javasampleiaik.jar file.
	Then, run 'pkcs.javasampleiaik_execution.bat' to run the sample.

		----------------------------------------------------

3 - Sample description

	You must be familiar with the PKCS #11 specifications to use this sample.
	
	This Java applet relies on acpkcs211.dll implementing the PKCS #11 API and on a Java Native Interface (for example, iaikPkcs11Wrapper.jar installed with Oracle Java).
	
	It demonstrates the following PKCS #11 functions: 
C_GetInfo, 
C_Initialize (through the constructor of the JNI wrapper), 
C_GetFunctionList (through the constructor of the JNI wrapper), 
C_GetSlotList, 
C_GetSlotInfo, 
C_GetTokenInfo, 
C_OpenSession, 
C_CloseSession, 
C_FindObjectsInit, 
C_FindObjects, 
C_FindObjectsFinal, 
C_GetAttributeValue, 
C_Login,
C_Logout, 
C_SignInit, 
C_Sign, 
C_EncryptInit,
C_Encrypt, 
C_DecryptInit, 
C_Decrypt, 
C_VerifyInit, 
C_Verify, 
C_SetPIN, 
C_CreateObject, 
C_DestroyObject